<%@ page import="java.sql.Connection" %>
<%@ page import="ljx.JdbcUtils" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>

<body>


<div class="header" id="head">
    <style >
        *{ margin:0px; padding:0px;}
        #nav{ width:600px; height:20px;position: relative; left:310px}
        #nav ul{ list-style:none;}
        #nav ul li{ float:left; line-height:40px; text-align:center; position:relative;}
        #nav ul li a{ text-decoration:none; color:#000; display:block;padding:0px 10px;}
        #nav ul li a:hover{ color:#FFF; background:#333}
        #nav ul li ul{ position:relative; display:none;}
        #nav ul li ul li{ float:none;line-height:20px; text-align:left;}
        #nav ul li ul li a{ width:100%; }
        #nav ul li ul li a:hover{ background-color: dodgerblue;}
        #nav ul li:hover ul{ display:block}
    </style>

    <div id="nav">
        <ul>
            <li><a href="login.jsp">首页</a></li>
            <li><a href="#">学习中心</a>
                <ul style="size:15px;font-family: 华文仿宋;color: #666666">
                    <li><a href="index5.jsp">新建任务</a></li>
                    <li > <a href="index6.jsp">任务目录</a></li>
                </ul>
            </li>
            <li><a href="#">个人中心</a>
                <ul style="size:15px;font-family: 华文仿宋;color: #666666">
                    <li><a href="index3.jsp">管理员信息</a></li>
                    <li><a href="index3.jsp">所有信息</a></li>
               </ul>
            </li>
            <li><a href="index8.jsp">关于我们</a></li>
        </ul>
    </div>
</div>


<div class="wrap" id="wrap" >




    <%
        Connection conn = null;
        try {
            conn = JdbcUtils.getConnection();
            if(conn != null){
    %>
    <table style="position: relative;left: 220px;" border="2"  bgcolor="#ffebcd" bordercolor="red" width="550" height="150">
        <tr style="color: #8bbbf9">
            <td width="100" height="25" number="title">id</td>
            <td width="100" height="25" name="title">姓名</td>
            <td width="100" height="25" age="title">密码</td>
            <td width="100" height="25" age="title">邮件</td>
            <td width="100" height="25" age="title">生日</td>

        </tr>
        <%
            Statement stmt = null;
            ResultSet rs = null;
            String sql = "SELECT * FROM users;";  //查询语句
            stmt = conn.createStatement();
            rs = stmt.executeQuery(sql);
            out.print("  ");
            out.print("<br/>");
            out.print("<br/>");
            while (rs.next()) {%>
        <tr style="color: #666666">
            <td width="100" height="25" ><%=rs.getString("id") %></td>
            <td width="100" height="25"><%=rs.getString("NAME") %></td>
            <td width="100" height="25"><%=rs.getString("PASSWORD") %></td>
            <td width="100" height="25"><%=rs.getString("email") %></td>
            <td width="100" height="25"><%=rs.getString("birthday") %></td>
        </tr>
        <%
                    }
                }else{
                    out.print("连接失败！");
                }
            }catch (Exception e) {
                //e.printStackTrace();
                out.print("数据库连接异常！");
            }
        %>
    </table>
    </table>



</div>
</body>
</html>

<style type="text/css">
    *{
        margin:0;
        padding:0;
    }
    #wrap{
        height:400px;
        width:135%;
        background-image: url("tp2.jpg");
        text-align:center;
        position:relative;
    }
    #head{
        height:80px;
        width:100%;
        background-image: url("tp2.jpg");
        text-align:center;
        position:relative;
    }




</style>